<template>
  <div name="rightgoods">
    <div class="goods_box">
      <ul class="goods">
        <li
          :class="[index%4==3?'no_mar_rig':'','goods_list']"
          v-for="(item,index) in goodsData"
          :key="index"
        >
        <router-link class="list" to="/comdetail">
            <img class="goods_img" :src="item.goodsImg" alt />
            <div class="goods_name">{{item.goodsName}}</div>
            <div class="goods_explain">{{item.goodsExplain}}</div>
            <div class="goods_money">
              <span>{{item.money1}}元</span>
              <span v-if="item.qishow">起</span>
              <del class="delmoney" v-if="item.delmoney">{{item.delmoney}}元</del>
            </div>
          </router-link>
        </li>

        <!-- 最后部分 -->
        <li class="last_box" v-if="openlast">
          <div class="last_con" v-if="lastgood">
            <router-link  to="/comdetail" class="last_list" v-for="(item,index) in lastgoodData" :key="index">
              <div class="last_left">
                <div class="last_good_name">{{item.lastGoodName}}</div>
                <div class="last_good_money">
                  <span>{{item.lastGoodMoney}}元</span>
                  <span v-if="item.qishow">起</span>
                </div>
              </div>
              <div class="last_right">
                <img class="last_good_img" :src="item.lastGoodImg" alt />
              </div>
            </router-link>
          </div>
          <div class="last_con">
            <div class="last_list">
              <div class="last_left">
                <div class="last_title">查看更多</div>
                <div class="last_tips">热门</div>
              </div>
              <div class="last_right">
                <div class="iconfont icon-youjt1"></div>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // openlast: false,
      // lastgood: false,
      // lastgoodlist: [
      //   {
      //     lastGoodName: 'Air 13.3" 2019款',
      //     lastGoodMoney: "4999",
      //     qishow: true
      //   }
      // ]
      // goodslist: []
    };
  },
  props: {
    // 是否开启最后一个小型的商品信息he查看更多列表
    openlast: {
      type: Boolean,
      // 默认值
      default: true
    },
    // 是否开启查看更多上面的商品信息
    lastgood: {
      type: Boolean,
      // 默认值
      default: true
    },
    // 主要列表数据
    goodsData: {
      type: Array,
      // 设置为必填
      required: true
    },
    // 最后一个商品数据
    lastgoodData: {
      type: Array
    }
  }
};
</script>

<style lang="scss" scoped>
@import "./RightGoods.scss";
</style>